﻿@{
    var entityTypeCode = ViewContext.RouteData.Values["Controller"].ToString();
    string codespace = ViewContext.RouteData.DataTokens["area"].ToString();
    var infoTabView = Html.GetRuntimeUivIew("Details");
    var menuTabView = Html.GetRuntimeUivIew("Menus");
    var prifix = "Ac_Function_Index_";
}
<div id="@(prifix)splitter" class="mini-splitter" vertical="true" style="width: 100%; height: 100%;">
    <div size="600" showcollapsebutton="true">
        <div class="mini-toolbar" style="border-left: 0; border-right: 0; border-top: 0px; padding: 2px;">
            <div style="float: left">
                @{Html.RenderPartial("Partials/UiViewButtons");}
                <a id="@(prifix)btnManage" class="mini-button" plain=" true" tooltip="托管" iconstyle="background: url(/content/icons/16x16/lock_go.png) no-repeat;" plain="true" @Html.IsEnabled(entityTypeCode, "Manage")>托管</a>
                <a id="@(prifix)btnUnManage" class="mini-button" plain=" true" tooltip="取消托管" iconstyle="background: url(/content/icons/16x16/lock_open.png) no-repeat;" plain="true" @Html.IsEnabled(entityTypeCode, "UnManage")>取消托管</a>
                <a id="@(prifix)btnClearCache" class="mini-button" plain=" true" tooltip="清除缓存" iconstyle="background: url(/content/icons/16x16/paintbrush.png) no-repeat;" plain="true" @Html.IsEnabled(entityTypeCode, "Refresh")>导入功能</a>
            </div>
            <div style="float: right">
            </div>
            <div style="clear: both;">
            </div>
        </div>
        <!--撑满页面-->
        <div class="mini-fit">
            <div id="@(prifix)datagrid1" class="mini-datagrid" style="width:100%;height:100%;" allowalternating="true"
                 url="@Url.Action("GetPlistFunctions")" idfield="Id" multiselect="true"
                 sizelist="[5,10,20,50]" pagesize="20" allowcellwrap="true" showfilterrow="true">
                <div property="columns">
                    <div type="indexcolumn"></div>
                    <div type="checkcolumn"></div>
                    <div name="action" width="70" headeralign="center" align="center" cellstyle="padding:0;">
                        <a id="@(prifix)btnSearchClear" property="filter" class="mini-button" style="float: right;">条件清空</a>
                    </div>
                    <div field="Description" width="220" headeralign="center" allowsort="true">
                        @Html.IconLabel("Description")
                        <input id="@(prifix)DescriptionFilter" name="Description" property="filter" class="mini-textbox" style="width: 100%;" />
                    </div>
                    <div field="ResourceCode" width="100" headeralign="center" allowsort="true">
                        @Html.IconLabel("ResourceCode")
                        <input id="@(prifix)ResourceCodeFilter" name="ResourceCode" property="filter" class="mini-textbox" style="width: 100%;" />
                    </div>
                    <div field="Code" width="180" headeralign="center" allowsort="true">
                        @Html.IconLabel("Code")
                        <input id="@(prifix)CodeFilter" name="Code" property="filter" class="mini-textbox" style="width: 100%;" />
                    </div>
                    <div field="IsUiView" width="40" headeralign="center" align="center" allowsort="true">
                        @Html.IconLabel("IsUiView")
                        <input id="@(prifix)IsUiViewFilter" property="filter" name="IsUiView" class="mini-combobox" style="width: 100%;" textfield="name"
                               valuefield="code" data="@Html.DicItemJsonArray(Html.GetProperty("IsUiView"))"
                               value="" shownullitem="true" />
                    </div>
                    <div field="DeveloperCode" width="60" headeralign="center" allowsort="true">
                        @Html.IconLabel("DeveloperCode")
                        <input id="@(prifix)DeveloperIdFilter" name="DeveloperId" property="filter" class="mini-combobox" style="width:100%;" textfield="name" valuefield="id"
                               data="@Html.DeveloperJsonArray()" shownullitem="true" value="" nullitemtext="" required="false" />
                    </div>
                    <div field="IsManaged" width="40" headeralign="center" align="center" allowsort="true">
                        @Html.IconLabel("IsManaged")
                        <input id="@(prifix)IsManagedFilter" property="filter" name="IsManaged" class="mini-combobox" style="width: 100%;" textfield="name"
                               valuefield="code" data="@Html.DicItemJsonArray(Html.GetProperty("IsManaged"))"
                               value="" shownullitem="true" />
                    </div>
                    <div field="IsEnabled" width="50" headeralign="center" align="center" allowsort="true">
                        @Html.IconLabel("IsEnabled")
                        <input id="@(prifix)IsEnabledFilter" property="filter" name="IsEnabled" class="mini-combobox" style="width: 100%;"
                               textfield="name" valuefield="code" data="@Html.DicItemJsonArray(Html.GetProperty("IsEnabled"))" shownullitem="true" />
                    </div>
                    <div field="SortCode" width="60" headeralign="center" align="center" allowsort="true">
                        @Html.IconLabel("SortCode")
                    </div>
                    <div field="CreateOn" width="130" headeralign="center" dateformat="yyyy-MM-dd HH:mm:ss" allowsort="true">
                        @Html.IconLabel("CreateOn")
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div showcollapsebutton="true">
        <div id="@(prifix)tabs1" class="mini-tabs" style="width: 100%; height: 100%;display:none;"
             activeindex="0" bodystyle="padding:0;border:0;">
            <div name="infoTab" bodycls="inner" title="@infoTabView.Title" iconstyle="background:url(/content/icons/16x16/@infoTabView.Icon)">
            </div>
            @{
                var operationLogView = this.GetOperationLogEntityType();
                if (operationLogView.Permit())
                {
                    <div name="operationLogTab" bodycls="inner" title="@operationLogView.Title" iconstyle="background:url(/content/icons/16x16/@operationLogView.Icon)">
                    </div>
                }
            }
        </div>
    </div>
</div>
@if (!string.IsNullOrEmpty(Request["isInner"]))
{
    var entityType = Html.GetEntityType(codespace, entityTypeCode);
    string editWidth = entityType.EditWidth.ToString() + "px";
    string editHeight = entityType.EditHeight.ToString() + "px";
    if (this.CurrentUser().Permit(entityTypeCode, "Add") || this.CurrentUser().Permit(entityTypeCode, "Update"))
    {
        <div id="@(prifix)Edit_win1" class="mini-window" title="" style="width: @editWidth; height: @editHeight;display:none;"
             showmaxbutton="true" showfooter="true" showtoolbar="true"
             showmodal="true" allowresize="true" allowdrag="true">
            @{ Html.RenderPartial("Partials/EditBar", prifix + "Edit_"); }
            @{ Html.RenderPartial("Partials/Edit", prifix + "Edit_"); }
        </div>
    }
    <script type="text/javascript" src="@Url.Content("~/Scripts/Areas/Ac/Function/Index.cshtml.js")"></script>
}
@if (Request.IsAjaxRequest())
{
    <script src="@Url.Content("~/Scripts/tooltipBoot.js")"></script>
}